<template>
    <div class="words">
        <div class="hotWord">
            <span v-for="word in hotWorks" :key="word.searchWord"
                @click="$emit('changekeyword',word.searchWord)"
            >
            {{word.searchWord}}</span>
        </div>
        <div class="history">
            <!-- 搜索历史 把搜索匹配的数据存入 -->
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return {
            hotWorks:[],
        }
    },
    created(){
        this.axios.get("/search/hot/detail")
        .then(result=>{
            this.hotWorks=result.data.slice(0,10);
        });
    },
}
</script>
<style lang="less" scoped>
.hotWord{
    overflow: hidden;
    span{
        float: left;
        line-height: 16px;
        padding: 5px 10px;
        margin: 5px;
        border: 1px solid #d3d4da;
        border-radius: 14px;
    }
}
</style>